package com.framework.core.event.init;

import com.framework.core.service.SysDictService;
import lombok.extern.log4j.Log4j2;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * 加载数据库字典数据到内存
 *
 * @author lihanbo
 * @date 2021/8/20 11:03
 */
@Component
@Slf4j
public class SysDictInit {

    @Autowired
    private SysDictService sysDictService;

    @PostConstruct
    public void initDict() {
        log.info("-------------------------开始初始化数据字典-------------------------");
        sysDictService.initDictTrans();
        log.info("-------------------------初始化数据字典完成---------------------------");
    }

}
